home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Information / CSMP Digest / volume 1 / csmp-v1-166.txt < prev    next >
Text File  |  1992-12-31  |  57KB  |  1,499 lines

  1. C.S.M.P. Digest             Thu, 13 Aug 92       Volume 1 : Issue 166
  2.  
  3. Today's Topics:
  4.  
  5.     Determining if Color is available
  6.     Distributed and background processing
  7.     MacApp versus TCL
  8.  
  9.  
  10.  
  11. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  12.  
  13. The digest is a collection of article threads from the internet newsgroup
  14. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  15. regularly and want an archive of the discussions.  If you don't know what a
  16. newsgroup is, you probably don't have access to it.  Ask your systems
  17. administrator(s) for details.  (This means you can't post questions to the
  18. digest.)
  19.  
  20. Each issue of the digest contains one or more sets of articles (called
  21. threads), with each set corresponding to a 'discussion' of a particular
  22. subject.  The articles are not edited; all articles included in this digest
  23. are in their original posted form (as received by our news server at
  24. cs.uoregon.edu).  Article threads are not added to the digest until the last
  25. article added to the thread is at least one month old (this is to ensure that
  26. the thread is dead before adding it to the digest).  Article threads that
  27. consist of only one message are generally not included in the digest.
  28.  
  29. The entire digest is available for anonymous ftp from ftp.cs.uoregon.edu
  30. [128.223.8.8] in the directory /pub/mac/csmp-digest.  Be sure to read the
  31. file /pub/mac/csmp-digest/README before downloading any files.  The most
  32. recent issues are available from sumex-aim.stanford.edu [36.44.0.6] in the
  33. directory /info-mac/digest/csmp.  If you don't have ftp capability, the sumex
  34. archive has a mail server; send a message with the text '$MACarch help' (no
  35. quotes) to LISTSERV@ricevm1.rice.edu for more information.
  36.  
  37. The digest is also available via email.  Just send a note saying that you
  38. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  39. automatically receive each new issue as it is created.  Sorry, back issues
  40. are not available through the mailing list.
  41.  
  42. Send administrative mail to mkelly@cs.uoregon.edu.
  43.  
  44.  
  45. -------------------------------------------------------
  46.  
  47. From: dave@gergo.tamu.edu (Dave Martin)
  48. Subject: Determining if Color is available
  49. Organization: Geochemical & Environmental Research Group, Texas A&M University
  50. Date: Tue, 30 Jun 1992 13:03:00 GMT
  51.  
  52. Hi, guys. Thanks for the helpful answers to my previous novice queries.
  53. Here's another:
  54.  
  55. My app does not use color *except* within the About... box. That's the
  56. only place -- the DITL has a color PICT resource. In order to improve
  57. the appearance of the About... box when run in monochrome I want to
  58. test the mode and, if the main device is color capable, and using color,
  59. then I put up DLOG 128, otherwise I use DLOG 129. I'm using the device
  60. routines -- GetMainDevice (testing .gdMode) and TestDeviceAttribute. It
  61. works fine on my IIsi/13" RGB in color or mono mode -- the appropriate
  62. dialog comes up based on the setting.
  63. However, I would assume that the device routines do not work on any Mac
  64. which came before the Mac II (those without Color QuickDraw -- the SE,
  65. for instance), and in fact I get an unimplemented trap bomb at the
  66. point that the About... box should be displayed when I run it on an SE. 
  67.  
  68. So, in brief, is there a procedure or function which I can call that will
  69. tell me (even on a pre-color Mac) if color is there? If not, I'll probably
  70. stick with my color About... box -- assuming I can do that even on an SE.
  71.  
  72. Thanks greatly in advance. 
  73.  
  74.  -                                                                     -
  75.  - Dave Martin - Geochemical & Environmental Research Group, Texas A&M - 
  76.  - DAVE@GERGA[GERGO,GERGI].TAMU.EDU - BROOKS@TAMVXOCN.BITNET - AOL:DBM -
  77.  -                                                                     -
  78.  
  79. +++++++++++++++++++++++++++
  80.  
  81. From: anders@verity.com (Anders Wallgren)
  82. Date: 30 Jun 92 17:46:59 GMT
  83. Organization: Verity, Inc., Mountain View, CA, USA
  84.  
  85. In article <30JUN199207033032@gergo.tamu.edu> Dave Martin,
  86. dave@gergo.tamu.edu writes:
  87. >So, in brief, is there a procedure or function which I can call
  88. that will
  89. >tell me (even on a pre-color Mac) if color is there? If not, I'll
  90. probably
  91. >stick with my color About... box -- assuming I can do that even on
  92. an SE.
  93.  
  94. You should use Gestalt to test for the gestaltQuickdrawFeatures -
  95. bit 0 will tell you if Color Quickraw is present.
  96.  
  97. +++++++++++++++++++++++++++
  98.  
  99. From: dave@gergo.tamu.edu (Dave Martin)
  100. Date: 30 Jun 92 21:58:00 GMT
  101. Organization: Geochemical & Environmental Research Group, Texas A&M University
  102.  
  103. In article <1992Jun30.174659.27443@verity.com>, Anders Wallgren <anders@verity.com> writes...
  104. >You should use Gestalt to test for the gestaltQuickdrawFeatures -
  105. >bit 0 will tell you if Color Quickraw is present.
  106.  
  107. Thanks, but Gestalt doesn't work under all Macs (Plus and up) and all Systems
  108. greater than or equal to 6.x, does it? Isn't that a Sys7-specific set of
  109. calls, or am I mistaken there? If I am, then I'll certainly try the Gestalt
  110. routines and see if they do what I need. Thanks. 
  111.  
  112.  -                                                                     -
  113.  - Dave Martin - Geochemical & Environmental Research Group, Texas A&M - 
  114.  - DAVE@GERGA[GERGO,GERGI].TAMU.EDU - BROOKS@TAMVXOCN.BITNET - AOL:DBM -
  115.  -                                                                     -
  116.  
  117. +++++++++++++++++++++++++++
  118.  
  119. From: potts@itl.itd.umich.edu (Paul Potts)
  120. Organization: Instructional Technology Laboratory, University of Michigan
  121. Date: Thu, 2 Jul 92 12:45:47 GMT
  122.  
  123. In article <30JUN199215582455@gergo.tamu.edu> dave@gergo.tamu.edu (Dave Martin) writes:
  124. >In article <1992Jun30.174659.27443@verity.com>, Anders Wallgren <anders@verity.com> writes...
  125. >>You should use Gestalt to test for the gestaltQuickdrawFeatures -
  126. >>bit 0 will tell you if Color Quickraw is present.
  127. >
  128. >Thanks, but Gestalt doesn't work under all Macs (Plus and up) and all Systems
  129. >greater than or equal to 6.x, does it? Isn't that a Sys7-specific set of
  130. >calls, or am I mistaken there? If I am, then I'll certainly try the Gestalt
  131. >routines and see if they do what I need. Thanks. 
  132.  
  133. Yes and no. Yes, the Gestalt trap itself is only in later system version.
  134. No, you don't always need to have that system version to call Gestalt. Recent
  135. versions of both THINK C and MPW will emulate Gestalt in glue if it is not
  136. really available. This means that you can get a decent amount of information
  137. by calling Gestalt even under older systems, and the glue code will use the
  138. older SysEnvirons and whatever else it needs to in order to answer you as best
  139. as it can. If it can't figure it out you'll probably get a result code
  140. returned. For basic things like color I'd say go ahead and use Gestalt and
  141. assume it will work on any machine.
  142. If the call says it doesn't know the answer, assume the functionality isn't
  143. there, I guess.
  144.  
  145.  
  146. - -- 
  147. The essence of OOP: "With all this horse manure, I know there's got to be
  148.                      a pony in here somewhere!"
  149. Paul R. Potts, Software Designer --- potts@itl.itd.umich.edu <--- me!
  150.  
  151. +++++++++++++++++++++++++++
  152.  
  153. From: lsr@taligent.com (Larry Rosenstein)
  154. Date: 2 Jul 92 17:53:52 GMT
  155. Organization: Taligent, Inc.
  156.  
  157. In article <1992Jun30.174659.27443@verity.com>, Anders Wallgren
  158. <anders@verity.com> wrote:
  159. > In article <30JUN199207033032@gergo.tamu.edu> Dave Martin,
  160. > dave@gergo.tamu.edu writes:
  161. > >So, in brief, is there a procedure or function which I can call
  162. > that will
  163. > >tell me (even on a pre-color Mac) if color is there? If not, I'll
  164. > probably
  165. > >stick with my color About... box -- assuming I can do that even on
  166. > an SE.
  167. > You should use Gestalt to test for the gestaltQuickdrawFeatures -
  168. > bit 0 will tell you if Color Quickraw is present.
  169.  
  170. That's a necessary test but not sufficient.  You can have Color QuickDraw
  171. but the screen could be in B&W mode.  To test for the latter, you need to
  172. use the graphic device manager to see how deep the screen really is.
  173.  
  174. And you can display a color PICT on a Mac SE (unless it's running some
  175. really, really old system).  It may not look very good, however.
  176.  
  177. Larry Rosenstein
  178. Taligent, Inc.
  179.  
  180. lsr@taligent.com
  181.  
  182. +++++++++++++++++++++++++++
  183.  
  184. From: ericsc@microsoft.com (Eric Schlegel)
  185. Date: 02 Jul 92 16:33:55 GMT
  186. Organization: Microsoft Corporation
  187.  
  188. In article <1992Jun30.174659.27443@verity.com> Anders Wallgren <anders@verity.com> writes:
  189. >In article <30JUN199207033032@gergo.tamu.edu> Dave Martin,
  190. >dave@gergo.tamu.edu writes:
  191. >>So, in brief, is there a procedure or function which I can call that will
  192. >>tell me (even on a pre-color Mac) if color is there? If not, I'll probably
  193. >>stick with my color About... box -- assuming I can do that even on an SE.
  194. >
  195. >You should use Gestalt to test for the gestaltQuickdrawFeatures -
  196. >bit 0 will tell you if Color Quickraw is present.
  197.  
  198. No, don't do that - gestaltQuickdrawFeatures is broken, and will always
  199. tell you that Color QD is present, even on a non-CQD machine. I usually
  200. either check for the presence of _OpenCPort or use gestaltQuickdrawVersion.
  201.  
  202. - -eric
  203. - -------
  204. My opinion, not Microsoft's.
  205.  
  206.  
  207. +++++++++++++++++++++++++++
  208.  
  209. From: jsp@uts.amdahl.com (James Preston)
  210. Date: 7 Jul 92 21:04:35 GMT
  211. Organization: Amdahl Corporation, Sunnyvale CA
  212.  
  213. potts@itl.itd.umich.edu (Paul Potts) writes:
  214.  
  215. }No, you don't always need to have that system version to call Gestalt. Recent
  216. }versions of both THINK C and MPW will emulate Gestalt in glue if it is not
  217. }really available. 
  218.  
  219. Can you tell me where this is documented for THINK C?  I have THINK C 5.0
  220. and I looked through the manuals for any mention of this exact issue, and
  221. I could find no mention of it.  So to be safe, I used the "Is Trap Available"
  222. code from Inside Mac VI before calling Gestalt.  But I would like to know
  223. if I can save myself the trouble in the future.
  224.  
  225. }For basic things like color I'd say go ahead and use Gestalt and
  226. }assume it will work on any machine.
  227.  
  228. I don't know, call me overly-cautious, but without a definitive answer
  229. to the question of whether your development environment will always generate
  230. the correct glue code, I wouldn't recommend risking having your application
  231. bomb with an unknown trap error.
  232.  
  233. - --James Preston
  234.  
  235. +++++++++++++++++++++++++++
  236.  
  237. From: keith@taligent.com (Keith Rollin)
  238. Date: 8 Jul 92 17:54:25 GMT
  239. Organization: Taligent
  240.  
  241. In article <aell03zA2cLM00@amdahl.uts.amdahl.com>, jsp@uts.amdahl.com (James
  242. Preston) writes:
  243. > potts@itl.itd.umich.edu (Paul Potts) writes:
  244. > }No, you don't always need to have that system version to call Gestalt. Recent
  245. > }versions of both THINK C and MPW will emulate Gestalt in glue if it is not
  246. > }really available. 
  247. > Can you tell me where this is documented for THINK C?  I have THINK C 5.0
  248. > and I looked through the manuals for any mention of this exact issue, and
  249. > I could find no mention of it.  So to be safe, I used the "Is Trap Available"
  250. > code from Inside Mac VI before calling Gestalt.  But I would like to know
  251. > if I can save myself the trouble in the future.
  252. > }For basic things like color I'd say go ahead and use Gestalt and
  253. > }assume it will work on any machine.
  254. > I don't know, call me overly-cautious, but without a definitive answer
  255. > to the question of whether your development environment will always generate
  256. > the correct glue code, I wouldn't recommend risking having your application
  257. > bomb with an unknown trap error.
  258.  
  259.  
  260. "OK, you're overly-cautious". You have the information available to you to
  261. determine if you need to check if Gestalt exists or not. Open up your
  262. GestaltEqu.h file. Scroll down to the bottom and you'll see the following:
  263.  
  264. #if SystemSevenOrLater
  265. #pragma parameter __D0 Gestalt(__D0,__A1)
  266. pascal OSErr Gestalt(OSType selector,long *response)
  267.  = {0xA1AD,0x2288}; 
  268. #else
  269. pascal OSErr Gestalt(OSType selector,long *response);
  270. #endif
  271.  
  272.  
  273. This shows that Gestalt is a library call under the normal case; it is only a
  274. direct call to the trap if you explicitly define SystemSevenOrLater to be
  275. non-zero. Since the only reason for the glue is to see if the Gestalt trap is
  276. implemented and emulate it if not, you can safely avoid checking yourself if you
  277. call the library version of Gestalt.
  278.  
  279. Note: page 3-33 of IM VI says that MPW 3.2 and later implement Gestalt as glue.
  280. Since THINK C now uses MPW headers and libraries, this comment applies to THINK
  281. C, too.
  282.  
  283. (Is this in the RTFFAQ yet?)
  284.  
  285. - --
  286. Keith Rollin
  287. Phantom Programmer
  288. Taligent, Inc.
  289.  
  290. +++++++++++++++++++++++++++
  291.  
  292. From: scott@mcl.ucsb.edu (Scott Bronson)
  293. Date: 8 Jul 92 10:49:42 GMT
  294.  
  295. Here's how I decide what to display (pseudocode here because it looks like the
  296. original author has working real code to accomplish DeviceIsDisplayingColor).
  297.  
  298. err = SysEnvirons( &thisMahcine )
  299. // I think SysEnvirons is present in System 4.2 and higher.
  300. // Glue will allow it to work on all systems under MPW and THINK, though.
  301. if( thisMachine.hasColorQD && DeviceIsDisplayingColor() ) {
  302.     Draw your color pict
  303. } else {
  304.     Draw your b&w pict
  305. }
  306.  
  307. SysEnvirons seems to work for me.
  308.  
  309.     - Scott
  310.  
  311. ---------------------------
  312.  
  313. From: kamprath@caen.engin.umich.edu (Michael F. Kamprath)
  314. Subject: Distributed and background processing
  315. Date: 3 Jul 92 13:06:18 GMT
  316. Organization: University of Michigan
  317.  
  318. I write alot of computational programs, and I always hate it that my computer
  319. is essentially unusable during the computational loops.  I typically
  320. put SystemTask() into each loop so that at least my screen saver will kick in.
  321. I was wondering, how would I write an iterative computational loop such that
  322. my program is "backgroundable" and will still "compute" answers.  Also,
  323. I understand that under system 7, one computer can use "extra" CPU cycles on
  324. on macs on the network.  Is this useful enough to increase computational speed,
  325. and, if so, how would you program it (for floating point type computations)?
  326.  
  327. Thanks
  328.  
  329. MIchael Kamprath
  330. kamprath@caen.engin.umich.edu
  331.  
  332. +++++++++++++++++++++++++++
  333.  
  334. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  335. Organization: Royal Institute of Technology, Stockholm, Sweden
  336. Date: Fri, 3 Jul 1992 15:13:39 GMT
  337.  
  338. .edu> kamprath@caen.engin.umich.edu (Michael F. Kamprath) writes:
  339.  
  340.    I write alot of computational programs, and I always hate it that my computer
  341.    is essentially unusable during the computational loops.  I typically
  342.    put SystemTask() into each loop so that at least my screen saver will kick in.
  343.    I was wondering, how would I write an iterative computational loop such that
  344.    my program is "backgroundable" and will still "compute" answers.  Also,
  345.  
  346. Well, you could put all your event handling code into a function
  347. HandleEvent, and do something like:
  348.  
  349. EventRecord er ;
  350. long l = TickCount ( ) + 3 ;
  351.  
  352.     for ( i = 0 ; i < 100000 ; i ++ ) {
  353.  
  354.         for ( j = 0 ; j < 10000 ; j ++ ) {
  355.  
  356.             q += j + i ;
  357.         }
  358.  
  359.         if ( TickCount ( ) > l ) {
  360.  
  361.             if ( WaitNextEvent ( -1 , & er , 0L , NULL ) ) {
  362.  
  363.                 HandleEvent ( & er ) ;
  364.             }
  365.             l = TickCount ( ) + 3 ;
  366.         }
  367.     }
  368.  
  369.  
  370. Don't put the idle in the innermost loop. Don't idle unless some
  371. substantial time has passed. If you don't care about window
  372. updating etc, you can omit HandleEvent and pass 0 as first arg
  373. to WaitNextEvent to get a null event back.
  374.  
  375.    I understand that under system 7, one computer can use "extra" CPU cycles on
  376.    on macs on the network.  Is this useful enough to increase computational speed,
  377.    and, if so, how would you program it (for floating point type computations)?
  378.  
  379. You'd have to have independent portions of your code (like individual
  380. segments in ray tracing) and use the networking primitives like
  381. AppleEvents or PPC Toolbox - and run the application on both macs,
  382. of course.
  383.  
  384. - -- 
  385.          Jon W{tte, Svartmangatan 18, S-111 29 Stockholm, Sweden
  386.  
  387.  "Difficult, obscure, incoherent and nonstandard does not imply more power."
  388.                - Andrew Kass in comp.sys.mac.hardware
  389.  
  390. +++++++++++++++++++++++++++
  391.  
  392. From: Bruce.Hoult@bbs.actrix.gen.nz
  393. Date: 3 Jul 92 15:05:40 GMT
  394. Organization: Actrix Information Exchange
  395.  
  396. In article <rtH-mc-@engin.umich.edu> kamprath@caen.engin.umich.edu (Michael F. Kamprath) writes:
  397. > I write alot of computational programs, and I always hate it that my computer
  398. > is essentially unusable during the computational loops.  I typically
  399. > put SystemTask() into each loop so that at least my screen saver will kick in.
  400. > I was wondering, how would I write an iterative computational loop such that
  401. > my program is "backgroundable" and will still "compute" answers.
  402.  
  403. The basic idea is to call "EventAvail" in your loops.  This will allow other
  404. programs to run under MultiFinder just as "GetNextEvent" will.
  405.  
  406. You don't realy want to call EventAvail every time around your loops otherwise
  407. your computation will crawl.  The best idea is probably to do about
  408. 1/60 of a second of computation in between calls to EventAvail by checking
  409. for TickCount to change.
  410.  
  411. Something like this could be good:
  412.  
  413. var
  414.    lastTick: longint;
  415.  
  416. {...}
  417.  
  418. while ... do begin
  419.  
  420.    {your stuff}
  421.  
  422.    if TickCount <> lastTick then begin
  423.       lastTick := TickCount;
  424.       junkBoolean := EventAvail(everyEvent,junkEvent);
  425.    end;
  426.  
  427. end
  428.  
  429. For convienience make this a procedure BeNice.
  430. For maximum performance you could check the value of the global variable
  431. Ticks at $16A instead of calling the trap:
  432.  
  433. var
  434.    TickPtr: ^longint;
  435.  
  436. TickPtr = Pointer($16A);
  437.  
  438. if TickPtr^ <> lastTick then ... etc
  439.  
  440.  
  441. If even the cost of a single function call is too much then you could use
  442. an inline or (in C) a macro, but that is almost certainly unnecessary.
  443. - -- 
  444. Bruce.Hoult@bbs.actrix.gen.nz   Twisted pair: +64 4 477 2116
  445. BIX: brucehoult                 Last Resort:  PO Box 4145 Wellington, NZ
  446. "Cray's producing a 200 MIPS personal computer with 64MB RAM and a 1 GB
  447. hard disk that fits in your pocket!"   "Great!  Is it PC compatable?"
  448.  
  449. +++++++++++++++++++++++++++
  450.  
  451. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  452. Date: 4 Jul 92 00:28:03 GMT
  453. Organization: Royal Institute of Technology, Stockholm, Sweden
  454.  
  455. .gen.nz> Bruce.Hoult@bbs.actrix.gen.nz writes:
  456.  
  457.    your computation will crawl.  The best idea is probably to do about
  458.    1/60 of a second of computation in between calls to EventAvail by checking
  459.    for TickCount to change.
  460.  
  461. I think you actually should hog the CPU more, like 3 or 4 ticks.
  462. (See my previous post) else you will crawl anyway...
  463.  
  464.    For convienience make this a procedure BeNice.
  465.  
  466. And lose even more performance. Procedure calls cost, even more
  467. in Pascal than in C. (Preferrably with register arguments)
  468.  
  469.    For maximum performance you could check the value of the global variable
  470.    Ticks at $16A instead of calling the trap:
  471.  
  472. NO ! NO ! NO ! Don't use lo-mem globals !
  473.  
  474. Ticks happen to BREAK under A/UX, and thus will do so under the
  475. MicroKernel, RISC Macs, System 8, System 7.0.2 (OK, maynbe not)
  476. etc...
  477.  
  478. Call TickCount.
  479.  
  480. - -- 
  481.          Jon W{tte, Svartmangatan 18, S-111 29 Stockholm, Sweden
  482.  
  483.  "Difficult, obscure, incoherent and nonstandard does not imply more power."
  484.                - Andrew Kass in comp.sys.mac.hardware
  485.  
  486. +++++++++++++++++++++++++++
  487.  
  488. From: Bruce.Hoult@bbs.actrix.gen.nz
  489. Date: 4 Jul 92 15:53:56 GMT
  490. Organization: Actrix Information Exchange
  491.  
  492. In article <D88-JWA.92Jul4012803@dront.nada.kth.se> d88-jwa@dront.nada.kth.se (Jon W{tte) writes:
  493. > .gen.nz> Bruce.Hoult@bbs.actrix.gen.nz writes:
  494. >    your computation will crawl.  The best idea is probably to do about
  495. >    1/60 of a second of computation in between calls to EventAvail by checking
  496. >    for TickCount to change.
  497. > I think you actually should hog the CPU more, like 3 or 4 ticks.
  498. > (See my previous post) else you will crawl anyway...
  499.  
  500. Gee, I guess I'm doing everything wrong today.
  501.  
  502. As it happens, I think 3 or 4 ticks is too much.  One background program
  503. like that would be OK, but three or four would *seriously* impact response
  504. time.
  505.  
  506. You can get a lot of work done in a tick, and task switches don't take all
  507. that long. 
  508.  
  509.  
  510. >    For convienience make this a procedure BeNice.
  511. > And lose even more performance. Procedure calls cost, even more
  512. > in Pascal than in C. (Preferrably with register arguments)
  513. >    For maximum performance you could check the value of the global variable
  514. >    Ticks at $16A instead of calling the trap:
  515. > NO ! NO ! NO ! Don't use lo-mem globals !
  516. > Ticks happen to BREAK under A/UX, and thus will do so under the
  517. > MicroKernel, RISC Macs, System 8, System 7.0.2 (OK, maynbe not)
  518. > etc...
  519. > Call TickCount.
  520.  
  521.  
  522. Let's get this straight:  a procedure call is too expensive, but a trap
  523. call is fine?  Yeah, right.
  524.  
  525. I didn't know that ticks breaks under A/UX (never seen the beast in captivity
  526. myself) but resorting to TickCount is completely unnecessary.  There are
  527. two options:
  528.  
  529. 1) use GetTrapAddress on _TickCount and call it directly.
  530.  
  531. 2) to be even more efficient, forget TickCount entirely and insert your
  532.    own VBL task that increments one of your own global variables.
  533.  
  534. Either is easy to do.
  535. - -- 
  536. Bruce.Hoult@bbs.actrix.gen.nz   Twisted pair: +64 4 477 2116
  537. BIX: brucehoult                 Last Resort:  PO Box 4145 Wellington, NZ
  538. "Cray's producing a 200 MIPS personal computer with 64MB RAM and a 1 GB
  539. hard disk that fits in your pocket!"   "Great!  Is it PC compatable?"
  540.  
  541. +++++++++++++++++++++++++++
  542.  
  543. From: des7f@fulton.seas.Virginia.EDU (David E. Sappington)
  544. Date: 5 Jul 92 05:43:16 GMT
  545. Organization: University of Virginia
  546.  
  547. Bruce.Hoult@bbs.actrix.gen.nz writes:
  548. > your computation will crawl.  The best idea is probably to do about
  549. > 1/60 of a second of computation in between calls to EventAvail by checking
  550. > for TickCount to change.
  551.  
  552. d88-jwa@dront.nada.kth.se (Jon W{tte) replies:
  553. > I think you actually should hog the CPU more, like 3 or 4 ticks.
  554. > (See my previous post) else you will crawl anyway...
  555.  
  556. Bruce.Hoult@bbs.actrix.gen.nz replies back:
  557. > As it happens, I think 3 or 4 ticks is too much.  One background program
  558. > like that would be OK, but three or four would *seriously* impact response
  559. > time.                                                                                                                                  
  560.  
  561. My gut feeling is that, especially on slower CPUs, you should grab
  562. quite a bit more than a tick or two to keep the overhead low. 
  563. Furthermore the amount that you grab should vary depending on whether
  564. or not you're the foreground app and (of course!) both foreground and
  565. background values should be user setable.  My defaults are 6/15 in the
  566. background/foreground.  When the user wants to run flat out (and thus
  567. is willingly giving up interaction) he can set the values as high as 99
  568. ticks!
  569.  
  570. Multiple background apps each grabbing, say, 6 ticks at a pop don't seem
  571. to pound the foreground app too much.  Evidently, the MacOS' scheduler
  572. tries to give time to the foreground app on a regular basis regardless
  573. of the the # of background apps.  Thus the schedule might look something
  574. like <fore> <back 1> <fore> <back 2> <fore> <back 3> ... if the back's
  575. are piggy.
  576.  
  577. Bruce.Hoult@bbs.actrix.gen.nz writes:
  578. > You can get a lot of work done in a tick, and task switches don't take all
  579. > that long.                                                                
  580.  
  581. If your app is in the foreground you'll take a noticeable hit (I timed
  582. this once but don't have the #'s with me) and if you're in the background
  583. you'll get CLOBBERED!  Especially with the Sys 7 Finder running.
  584.  
  585. Bruce.Hoult@bbs.actrix.gen.nz writes:
  586. > For maximum performance you could check the value of the global variable
  587. > Ticks at $16A instead of calling the trap:                              
  588.  
  589. d88-jwa@dront.nada.kth.se (Jon W{tte) dutifully admonishes:
  590. >  NO ! NO ! NO ! Don't use lo-mem globals ! [the usually reasons why]
  591. > Call TickCount.
  592.  
  593. Bruce.Hoult@bbs.actrix.gen.nz replies:
  594. > Let's get this straight:  a procedure call is too expensive, but a trap
  595. > call is fine?  Yeah, right.
  596.  
  597. I agree completely with Bruce here.  Comparing two variables (a low-mem
  598. and a global) and branching on time outs is so fast that you can put
  599. it in a fairly tight loop and not take much of a hit.  A trap call could
  600. easily overwhelm such a loop.  Still, it's bad karma....
  601.  
  602. Bruce.Hoult@bbs.actrix.gen.nz suggests:
  603. > 1) use GetTrapAddress on _TickCount and call it directly.
  604.  
  605. Not good enough when you have the need for speed!
  606.  
  607. > 2) to be even more efficient, forget TickCount entirely and insert your
  608. >    own VBL task that increments one of your own global variables.
  609.  
  610. Now you're talkin'.  This can be even faster than using _Ticks -- just
  611. let the VBL also maintain a boolean global gTimeToYield.  A useful macro
  612. is then
  613.  
  614. #define BE_NICE  {if (gTimeToYield) CallGNEAndHandleIfNecessary();}
  615.  
  616. When the branch isn't taken the overhead is nearly nil no matter where
  617. you put the BE_NICEs.
  618.  
  619. Dave Sappington                     des7f@virginia.edu
  620. Institute for Parallel Computation  des7f@virginia.bitnet
  621. University of Virginia
  622.  
  623. +++++++++++++++++++++++++++
  624.  
  625. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  626. Date: 5 Jul 92 22:23:48 GMT
  627. Organization: Royal Institute of Technology, Stockholm, Sweden
  628.  
  629. .gen.nz> Bruce.Hoult@bbs.actrix.gen.nz writes:
  630.  
  631.    You can get a lot of work done in a tick, and task switches don't take all
  632.    that long. 
  633.  
  634. Depends on the machine... You could have it user configurable !
  635. A little slider from "Nice" to "Nasty" :-)
  636.  
  637.    >    For convienience make this a procedure BeNice.
  638.  
  639.    > And lose even more performance. Procedure calls cost, even more
  640.  
  641.    >    Ticks at $16A instead of calling the trap:
  642.    > 
  643.    > NO ! NO ! NO ! Don't use lo-mem globals !
  644.    > Ticks happen to BREAK under A/UX, and thus will do so under the
  645.  
  646.    > Call TickCount.
  647.  
  648.  
  649.    Let's get this straight:  a procedure call is too expensive, but a trap
  650.    call is fine?  Yeah, right.
  651.  
  652. You have a choice between inlining your code and calling a procedure.
  653. Inlining is faster; that's the way I go.
  654.  
  655. You have a choice between calling TickCount and reading Ticks.
  656. Calling TickCount works, Ticks doesn't. I know the way I'd go,
  657. i.e. THERE IS NO CHOICE !
  658.  
  659.    I didn't know that ticks breaks under A/UX (never seen the beast in
  660.    captivity myself) but resorting to TickCount is completely unnecessary.
  661.    There are two options:
  662.  
  663.    1) use GetTrapAddress on _TickCount and call it directly.
  664.  
  665. Not the best thing to do, since there's been vague warnings about
  666. this for several years.
  667.  
  668.    2) to be even more efficient, forget TickCount entirely and insert your
  669.       own VBL task that increments one of your own global variables.
  670.  
  671. Hmm. Maybe. Has some nice advantages, but this is what the Ticks
  672. mechanism already does, so you re-invent the wheel and lose
  673. performance by having the machine do the same thing twice :-)
  674.  
  675. - -- 
  676.          Jon W{tte, Svartmangatan 18, S-111 29 Stockholm, Sweden
  677.  
  678.  "Difficult, obscure, incoherent and nonstandard does not imply more power."
  679.                - Andrew Kass in comp.sys.mac.hardware
  680.  
  681. +++++++++++++++++++++++++++
  682.  
  683. From: des7f@fulton.seas.Virginia.EDU (David E. Sappington)
  684. Date: 6 Jul 92 00:55:31 GMT
  685. Organization: University of Virginia
  686.  
  687. Bruce.Hoult@bbs.actrix.gen.nz writes:
  688. >   2) to be even more efficient, forget TickCount entirely and insert your
  689. >      own VBL task that increments one of your own global variables.
  690.  
  691. d88-jwa@dront.nada.kth.se (Jon W{tte) replies:
  692. > Hmm. Maybe. Has some nice advantages, but this is what the Ticks
  693. > mechanism already does, so you re-invent the wheel and lose
  694. > performance by having the machine do the same thing twice :-)
  695.  
  696. Yes this is what the Ticks mechanism is supposed to do but if you can't
  697. use the low-memory global _Ticks then what good is it.  The trap's
  698. too slow and bypassing the trap manager to call the TickCount() routine
  699. directly has disadvantages as well.
  700.  
  701. Dave Sappington                     des7f@virginia.edu
  702. Institute for Parallel Computation  des7f@virginia.bitnet
  703. University of Virginia
  704.  
  705. +++++++++++++++++++++++++++
  706.  
  707. From: mtr@formtek.com (Marcel Rivard)
  708. Date: 6 Jul 92 00:26:15 GMT
  709. Organization: FORMTEK Inc.
  710.  
  711. kamprath@caen.engin.umich.edu (Michael F. Kamprath)
  712.  
  713. Michael,
  714.  
  715.  
  716. My favorite method of handling this is to use the Threads package out of
  717. Develop 6.  
  718. Set up the application with two threads of execution.  One to handle the
  719. UI, and the 
  720. second (and others) to handle computation.  Since the threads package is
  721. not pre-emptive,
  722. you need to call "Yield()" every once in a while within each thread to
  723. let other applications 
  724. run.  
  725.  
  726. The biggest advantages of this method are that the UI is fully active,
  727. and there is only one
  728. WaitNextEvent() call that handles all events as read events.
  729.  
  730.  
  731.  
  732. Marcel Rivard
  733.  
  734. +++++++++++++++++++++++++++
  735.  
  736. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  737. Date: 7 Jul 92 06:41:17 GMT
  738. Organization: University of Waikato, Hamilton, New Zealand
  739.  
  740. In article <D88-JWA.92Jul5232348@dront.nada.kth.se>, d88-jwa@dront.nada.kth.se (Jon W{tte) writes:
  741.  
  742. > You have a choice between calling TickCount and reading Ticks.
  743. > Calling TickCount works, Ticks doesn't. I know the way I'd go,
  744. > i.e. THERE IS NO CHOICE !
  745.  
  746. Is having your code break under A/UX such a big disadvantage? :-)
  747.  
  748. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  749. Computer Services Dept                     fax: +64-7-838-4066
  750. University of Waikato            electric mail: ldo@waikato.ac.nz
  751. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  752.  
  753. +++++++++++++++++++++++++++
  754.  
  755. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  756. Date: 6 Jul 92 13:01:43 GMT
  757. Organization: Royal Institute of Technology, Stockholm, Sweden
  758.  
  759. .ac.nz> ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  760.  
  761. [About calling TickCount, not reading Ticks]
  762.  
  763.    > You have a choice between calling TickCount and reading Ticks.
  764.    > Calling TickCount works, Ticks doesn't. I know the way I'd go,
  765.    > i.e. THERE IS NO CHOICE !
  766.  
  767.    Is having your code break under A/UX such a big disadvantage? :-)
  768.  
  769. Yes.
  770.  
  771. Go ask Alexis Rosen or Jim Jaruselski (hope the names are right)
  772. for instance :-)
  773.  
  774. Also, A/UX is in many ways a good purgatory for apps that want
  775. to run cleanly on future hardware and software platforms from
  776. apple.
  777.  
  778.  
  779. - -- 
  780.          Jon W{tte, Svartmangatan 18, S-111 29 Stockholm, Sweden
  781.  
  782.  "Difficult, obscure, incoherent and nonstandard does not imply more power."
  783.                - Andrew Kass in comp.sys.mac.hardware
  784.  
  785. +++++++++++++++++++++++++++
  786.  
  787. From: jim@jagubox.gsfc.nasa.gov (Jim Jagielski)
  788. Date: 6 Jul 92 13:45:53 GMT
  789. Organization: NASA/Goddard Space Flight Center
  790.  
  791. d88-jwa@dront.nada.kth.se (Jon W{tte) writes:
  792.  
  793.  
  794. >Go ask Alexis Rosen or Jim Jaruselski (hope the names are right)
  795.                             ----------
  796.                               ^
  797.                               |
  798.                              ack! :)
  799. - -- 
  800. ==============================================================================
  801. #include <std/disclaimer.h>
  802.  
  803.                 Jim Jagielski                  NASA/GSFC, Code 734.4
  804.           jim@jagubox.gsfc.nasa.gov             Greenbelt, MD 20771
  805.  
  806.                      "Squeak. Squeak, I tell you, squeak."
  807.  
  808. +++++++++++++++++++++++++++
  809.  
  810. From: mjeffery@reed.edu (Mark Jefferys)
  811. Date: 9 Jul 92 04:20:55 GMT
  812. Organization: Reed College, Portland, OR
  813.  
  814. In article <1992Jul6.005531.10915@murdoch.acc.Virginia.EDU> des7f@fulton.seas.Virginia.EDU (David E. Sappington) writes:
  815. %
  816. % [...] if you can't
  817. % use the low-memory global _Ticks then what good is it.  The trap's
  818. % too slow and bypassing the trap manager to call the TickCount() routine
  819. % directly has disadvantages as well.
  820.  
  821. If the difference between _Ticks and TickCount() is significant then
  822. it's probably being checked too often. TickCount() just doesn't change
  823. often.
  824.  
  825. It should probably be moved to a higher level of the loop. If the next
  826. level occurs too occasionally then decrement a variable and check
  827. TickCount() every N times.
  828.  
  829. - -- 
  830. Mark Jefferys        Internet: mjeffery@reed.edu
  831.  
  832. +++++++++++++++++++++++++++
  833.  
  834. From: coolidge@cs.uiuc.edu (John Coolidge)
  835. Date: 9 Jul 92 22:09:35 GMT
  836. Organization: A/UX Enabling Technologies - OS Group, Apple Computer, Inc.
  837.  
  838. ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  839. >In article <D88-JWA.92Jul5232348@dront.nada.kth.se>, d88-jwa@dront.nada.kth.se (Jon W{tte) writes:
  840. >> You have a choice between calling TickCount and reading Ticks.
  841. >> Calling TickCount works, Ticks doesn't. I know the way I'd go,
  842. >> i.e. THERE IS NO CHOICE !
  843.  
  844. >Is having your code break under A/UX such a big disadvantage? :-)
  845.  
  846. Having your code break under A/UX is _always_ a big disadvantage :-).
  847. Seriously, things that break under A/UX are much more likely to break
  848. under future releases of the MacOS than things that work under A/UX.
  849. Low memory globals, in particular, should be avoided whenever possible,
  850. since the hypothetical protected memory MacOS would probably dispense
  851. with many if not all of them. If your program is a one-shot,
  852. internal-use-only sort of thing (which I think the original poster was
  853. describing), using Ticks is fine. No commercial product, however,
  854. should ship if it doesn't run under A/UX (excepting hardware-bashers;
  855. they're excused since that's _our_ fault :-)).
  856.  
  857. Diamonds 1.6 appears to break this rule; it runs fine under A/UX, just
  858. _way too fast_. I suspect Ticks is the problem. We used to have an
  859. option to maintain Ticks in startmac (burned lots of extra time, but it
  860. worked). I think it's gone now. Maybe an INIT that kept up Ticks? Nah...
  861.  
  862. - --John
  863.  
  864.         It wasn't lies, Jenny, it was acting.
  865.                 -- Nevil Sinclair, _The_Rocketeer_
  866.  
  867. +++John L. Coolidge++++++++++++++++coolidge@apple.com+++++++++++++++++++++++
  868. I speak for myself, not for Apple Computer. Copyright 1992 John L. Coolidge.
  869. Copying allowed only if attributed, and if all copies may be further copied.
  870.  
  871. +++++++++++++++++++++++++++
  872.  
  873. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  874. Date: 10 Jul 92 17:34:28 +1200
  875. Organization: University of Waikato, Hamilton, New Zealand
  876.  
  877. In article <1992Jul9.220935.5954@m.cs.uiuc.edu>, coolidge@cs.uiuc.edu (John Coolidge) writes:
  878. > ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  879. >
  880. >>Is having your code break under A/UX such a big disadvantage? :-)
  881. >
  882. > Having your code break under A/UX is _always_ a big disadvantage :-).
  883. > Seriously, things that break under A/UX are much more likely to break
  884. > under future releases of the MacOS than things that work under A/UX.
  885.  
  886. I've heard this argument from Apple people too. I think it's what we used
  887. to refer to politely in my undergraduate days as a "hand-waving" argument.
  888.  
  889. There's only one case I can think of where A/UX really did presage things to
  890. come in Macintosh: and that was 32-bit addressing. I believe in just about
  891. every other respect, A/UX has actually been *behind* Macintosh in terms of
  892. support for new ways of doing things--32-bit QuickDraw, the new Sound Manager,
  893. System 7 and so on. Remember, these things broke old code, too.
  894.  
  895. Lawrence "If you want UNIX, get a @$#% UNIX box" D'Oliveiro
  896.  
  897. +++++++++++++++++++++++++++
  898.  
  899. From: laf@mitre.org (Lee Fyock)
  900. Date: 10 Jul 92 19:06:39 GMT
  901. Organization: The MITRE Corporation
  902.  
  903. OK, let's get back to the "distributed processing across the network"
  904. question.
  905.  
  906. But first...
  907. I think it would be way cool to have one generic scheduler to execute
  908. tasks on the mac.  A cool thing would be to build it into After Dark.
  909. Like the virex module, I'd like to see disk express, autodoubler and
  910. on location run as modules.  I dislike the fact that each has its
  911. own criteria (and patches!) as to when they should do their thing.
  912.  
  913. OK.  Given this, it would be awesome to have an after dark module
  914. or other program that would notice the mac is idle, broadcast on
  915. the local net "hey, I'm free" and accept connections to do number
  916. crunching.  The program would accept and run a program and pass
  917. the results back to the caller.  I've heard of something similar
  918. for the NeXT (called godzilla?), and several rendering packages
  919. on the mac are implementing something similar, but a generic
  920. capability would be extraordinarily useful.
  921.  
  922. You guys can kick around the p-code vs. assembly and other issues
  923. for a while...  :-)
  924.  
  925.  
  926. Have fun!
  927.  
  928. Lee Fyock
  929. laf@mitre.org
  930.  
  931. ---------------------------
  932.  
  933. From: dma@CS.Stanford.EDU (Domingo A. Mihovilovic)
  934. Subject: MacApp versus TCL
  935. Organization: Computer Science Department, Stanford University.
  936. Date: Mon, 6 Jul 1992 07:09:11 GMT
  937.  
  938.     I am trying to define my programming environment to produce
  939. a hopefully commercial application.
  940.  
  941.     I got Think Pascal and Think C. I have been learning about 
  942. the Think Class libraries and they look very good (I used to 
  943. do everything from scratch, but I will not do it anymore...).
  944.  
  945.     Is there any good reason why I should consider using 
  946. MacApp as my set of classes ? or MPW as my development environment ?
  947.  
  948.     Any idea if there is any "Think C++" under development ?
  949. (standard C++)
  950.  
  951.     Thanks for any information,
  952.  
  953. Domingo Mihovilovic
  954. dma@cs.stanford.edu
  955.  
  956.  
  957.  
  958. +++++++++++++++++++++++++++
  959.  
  960. From: mcmath@csb1.nlm.nih.gov (Chuck McMath)
  961. Date: 6 Jul 92 18:24:27 GMT
  962. Organization: MSD
  963.  
  964. In article <1992Jul6.070911.15862@CSD-NewsHost.Stanford.EDU>,
  965. dma@CS.Stanford.EDU (Domingo A. Mihovilovic) wrote:
  966. >     I am trying to define my programming environment to produce
  967. > a hopefully commercial application.
  968. >     I got Think Pascal and Think C. I have been learning about 
  969. > the Think Class libraries and they look very good (I used to 
  970. > do everything from scratch, but I will not do it anymore...).
  971. >     Is there any good reason why I should consider using 
  972. > MacApp as my set of classes ? or MPW as my development environment ?
  973. >     Any idea if there is any "Think C++" under development ?
  974. > (standard C++)
  975. >     Thanks for any information,
  976. > Domingo Mihovilovic
  977. > dma@cs.stanford.edu
  978.  
  979. Well, if you already have ThinkC & TCL that's a pretty strong argument to
  980. not switch into MPW.  Buying into MacApp & MPW is a pretty hefty amount,
  981. especially since you need 1. MPW Shell 2. C Compiler 3. C++ preprocessor 4.
  982. MacApp 5. Assembler (for parts of MacApp).  Hmm, I think that's it.  Heck,
  983. just buy ETO (that's a quarterly CD-ROM from Apple that contains ALL of
  984. their developement tools on it, everything listed above plus Pascal,
  985. ResEdit, code snippets, etc, etc, etc). Oh yeah, one small problem - ETO
  986. costs $1000 if you don't own any of the abovementioned stuff.
  987.  
  988. Of course, this doesn't address the differences between TCL and MacApp, and
  989. which is better for what purpose.  That's a pretty deep subject.  Suffice
  990. to say that you can produce good software with TCL and with MacApp.  MacApp
  991. puts you farther down the road (the dialog classes are excellent) but it
  992. costs a whole lot more in terms of $$$ and machine requirements.  If you
  993. have the bucks and a Mac IIx or better with at least 8 MB of RAM and a 150
  994. MB Hard disk, and a CD-ROM player, then maybe MPW/MacApp is the way to go. 
  995. But it has a pretty steep learning curve.  However, once you get over that
  996. curve, your programs are quite nice!
  997.  
  998. Symantec has said that when and if they come out with C++ it will be a
  999. separate product from ThinkC, so don't look for ThinkC to become ThinkC++
  1000. anytime soon.
  1001.  
  1002. chuck
  1003.  
  1004. |- chuck mcmath - mcmath@csb1.nlm.nih.gov - MSD, Inc. ------------|
  1005. |- National Library of Medicine - National Institutes of Health --|
  1006. |- Bethesda, MD 20894 ---- Spell(e)s better than Dan Quayle ------|
  1007. |- "Hey batter, hey batter, hey batter, swing" - Anon. -----------|
  1008.  
  1009. +++++++++++++++++++++++++++
  1010.  
  1011. From: lsr@taligent.com (Larry Rosenstein)
  1012. Organization: Taligent, Inc.
  1013. Date: Mon, 6 Jul 1992 20:42:39 GMT
  1014.  
  1015. In article <mcmath-060792141753@mcmathmac.nlm.nih.gov>,
  1016. mcmath@csb1.nlm.nih.gov (Chuck McMath) wrote:
  1017. > especially since you need 1. MPW Shell 2. C Compiler 3. C++ preprocessor 4.
  1018. > MacApp 5. Assembler (for parts of MacApp).  Hmm, I think that's it.  Heck,
  1019.  
  1020. You don't need an assembler unless you intend to rebuild MacApp from
  1021. scratch.  (Even then, I'm not sure it's needed.)  MacApp should come with
  1022. the assembler files already processed.
  1023.  
  1024. Also, you can use MacApp from MPW Object Pascal.  (Or if you have THINK
  1025. Pascal, you may be able to get MacApp 2.x and use MacApp from THINK
  1026. Pascal.)
  1027.  
  1028. Larry Rosenstein
  1029. Taligent, Inc.
  1030.  
  1031. lsr@taligent.com
  1032.  
  1033. +++++++++++++++++++++++++++
  1034.  
  1035. Organization: Queen's University at Kingston
  1036. Date: Monday, 6 Jul 1992 20:54:18 EDT
  1037. From: <CHARLESW@QUCDN.QueensU.CA>
  1038.  
  1039. 1)  Whether you choose TCL or MacApp, consider buying AppMaker from Bowers
  1040.     Development.  It is a very handy tool for building the interface, builds
  1041.     decent code for Pascal, C, Object Pascal, TCL, MacApp, and it's mild to
  1042.     your hands.
  1043.  
  1044. 2)  Larry Rosenstein modestly doesn't mention that there is a good book on
  1045.     MacApp (2.x) that he co-authored.  I don't know if there will be "update"
  1046.     to it (it is "Programming with MacApp" by David A Wilson, Larry S. Rosen-
  1047.     stein, and Dan Shafer  ISBN 0-201-09784-2  Addison Wesley Publishing).
  1048.     Although MacApp 2.x isn't the current version (unless you got caught
  1049.     using Pascal for your project), I believe most of the concepts will travel
  1050.     well.  (I haven't used the new version of MacApp.)
  1051.  
  1052.     I know that there is at least one TCL book in the works (and it is needed
  1053.     even though I think TCL is simpler) but whose to say when or if it will
  1054.     be available.
  1055.  
  1056.     Best wishes.  Once you start using an object-oriented language, you'll
  1057.     never want to go back...
  1058.  
  1059. .../dave   David Charlesworth
  1060.  
  1061. +++++++++++++++++++++++++++
  1062.  
  1063. From: ksand@apple.com (Kent Sandvik)
  1064. Date: 8 Jul 92 02:20:14 GMT
  1065. Organization: Apple Inc, Debugging Department
  1066.  
  1067. In article <lsr-060792133924@lsr.taligent.com>, lsr@taligent.com (Larry
  1068. Rosenstein) wrote:
  1069. > You don't need an assembler unless you intend to rebuild MacApp from
  1070. > scratch.  (Even then, I'm not sure it's needed.)  MacApp should come with
  1071. > the assembler files already processed.
  1072.  
  1073. Nearly true (I feel like a bandit correcting one of the founding designers
  1074. of MacApp...). We have a couple of asm files in the MacApp 3.0 library,
  1075. FloatWindow.a (with the floating window WDEF), UFailure.a, UMemory.a and
  1076. UPascalObject.a. Anyway the CD distributions have most possible library
  1077. configurations, however there's always a small chance that the developer
  1078. wants a library version not available on the CD.
  1079.  
  1080.  
  1081. Also, if you need to patch the sources 1) then asm is handy. The third
  1082. point 
  1083. is if someone wants to modify the WDEFs for their own liking, one could
  1084. write 
  1085. C code but asm is far more efficient.
  1086.  
  1087. Cheers,
  1088. Kent/DTS
  1089.  
  1090.  
  1091. 1) From additional DTS release notes concerning the future MacApp 3.0.1:
  1092. There is a problem that can prevent successfull linking when specifying a
  1093. - -modelfar build. The problem is evident in the InitLinkerSymbols PROC in
  1094. UPascalObject.a. It contains A5-relative references to SUPERCLASSTABLE,
  1095. CLASSTABLE, and SELECTORPROCTABLE such as 
  1096.  
  1097. LEA %_SUPERCLASSTABLE, A0
  1098.  
  1099. which are later patched like this
  1100.  
  1101. LEA *+xxxx,A0
  1102.  
  1103. If any of these modules fall farther than 32K away from the
  1104. InitLinkerSymbols instructions that reference them, a linker error will
  1105. occur. If this happens the linker error output might appear something like
  1106. this:
  1107.  
  1108.   ### While reading file
  1109. "avatar:MPW:MacApp:Libraries:.DebugSymFar:MacApp.lib"
  1110.   ### Link: INITLINKERSYMBOLS (32712)
  1111.   Reference to: %_SELECTORPROCTABLE in file:
  1112.   ### Link: Error: PC-relative edit, offset out of range. (Error 48)
  1113.   INITLINKERSYMBOLS (32712)
  1114.   Reference to: %_CLASSTABLE in file:
  1115.   ### Link: Error: PC-relative edit, offset out of range. (Error 48)
  1116. INITLINKERSYMBOLS (32712)
  1117.   Reference to: INITLINKERSYMBOLS in file: ### Link: Error: PC-relative
  1118. edit,
  1119. offset out of range. (Error 48) INITLINKERSYMBOLS (32712)
  1120.  
  1121.  
  1122.  
  1123. The following 3 changes to the UPascalObject.a file in the
  1124. MacApp:Libraries: folder fix this problem.
  1125.  
  1126. In the definition of PROC InitLinkerSymbols, find the line 
  1127.      If qModelFarCode then
  1128.  
  1129. Following this line are 3 "LEA" instructions and 3 "MOVE.L" instructions.
  1130. By changing the form of the LEA instructions, they can be changed into
  1131. - -model far references, and avoid the 32K limit.  Make the following 3
  1132. changes...
  1133.  
  1134.    lea %_SUPERCLASSTABLE(A5),A0
  1135. becomes
  1136.    lea (%_SUPERCLASSTABLE).L,A0
  1137.  
  1138.    lea %_CLASSTABLE(A5),A0
  1139. becomes
  1140.    lea (%_CLASSTABLE).L,A0
  1141.  
  1142. and 
  1143.  
  1144.    lea %_SELECTORPROCTABLE(A5),A0
  1145. becomes
  1146.    lea (%_SELECTORPROCTABLE).L,A0
  1147.  
  1148. +++++++++++++++++++++++++++
  1149.  
  1150. From: cory@enigami.mv.com (Cory Kempf)
  1151. Date: Wed, 8 Jul 92 12:38:49 EST
  1152. Organization: EnigamI, Inc., Nashua, NH
  1153.  
  1154.  
  1155. In article <1992Jul6.070911.15862@CSD-NewsHost.Stanford.EDU> (comp.sys.mac.programmer), dma@CS.Stanford.EDU (Domingo A. Mihovilovic) writes:
  1156.  
  1157. >    Is there any good reason why I should consider using 
  1158. >MacApp as my set of classes ? or MPW as my development environment ?
  1159.  
  1160. Just to muddy the waters, you might want to check out the announcement
  1161. about bedrock.  To put it succinctly, MacApp is dead, Symantec is
  1162. writing Bedrock, a cross platform object development environment,
  1163. apple is loaning its MacApp engineering team to Symantec.  I don't
  1164. know how this will affect TCL.  Nobody seems to know what kind of
  1165. distribution will be available (e.g. if the Source will be with us
  1166. :-) ), nor does anyone really know about upgrades.
  1167.  
  1168. At present, it looks like the people who listened to Apple's
  1169. preaching that MacApp was it will be taking it on the chin.
  1170.  
  1171. MPW's strength is for large, multi-person, multi-project development
  1172. efforts.  Think is great if you are doing a one person-one project
  1173. effort.
  1174.  
  1175. Think tends to bite it when new systems/platforms come out, where
  1176. as MPW tends to react a bit faster.
  1177.  
  1178. Think does not do C++ as yet.
  1179.  
  1180. +C
  1181.  
  1182.  
  1183. - -------------------------------------------------------------
  1184. Cory Kempf                    EnigamI, Inc.
  1185. cory@enigami.mv.com           ...!decvax!enigami!cory
  1186. Annon:    wi.5036@wizvax.methuen.ma.us
  1187. "Reporter : Mr Gandhi, what do you think of Western Civilization ?
  1188. Gandhi : I think it would be a good idea."
  1189.  
  1190. +++++++++++++++++++++++++++
  1191.  
  1192. From: mcmath@csb1.nlm.nih.gov (Chuck McMath)
  1193. Date: 9 Jul 92 11:28:26 GMT
  1194. Organization: MSD
  1195.  
  1196. In article <0105011F.814ipu@dragon.enigami.mv.com>, cory@enigami.mv.com
  1197. (Cory Kempf) wrote:
  1198. > In article <1992Jul6.070911.15862@CSD-NewsHost.Stanford.EDU> (comp.sys.mac.programmer), dma@CS.Stanford.EDU (Domingo A. Mihovilovic) writes:
  1199. > >    Is there any good reason why I should consider using 
  1200. > >MacApp as my set of classes ? or MPW as my development environment ?
  1201. > Just to muddy the waters, you might want to check out the announcement
  1202. > about bedrock.  To put it succinctly, MacApp is dead, Symantec is
  1203. > writing Bedrock, a cross platform object development environment,
  1204. > apple is loaning its MacApp engineering team to Symantec.  I don't
  1205. > know how this will affect TCL.  Nobody seems to know what kind of
  1206. > distribution will be available (e.g. if the Source will be with us
  1207. > :-) ), nor does anyone really know about upgrades.
  1208. > At present, it looks like the people who listened to Apple's
  1209. > preaching that MacApp was it will be taking it on the chin.
  1210.  
  1211. I think the above statements are way overblown.  Everything Apple has been
  1212. saying is that the *kinds* of things you learn by programming in MacApp are
  1213. going to transfer to Bedrock.  Sure, class names and some designs will be
  1214. different, and there will be new ground to conquer, but if you think you
  1215. will be at some sort of advantage by *waiting* then you are quite naive.
  1216.  
  1217. There's a lot to grasp when using object oriented frameworks and oo
  1218. programming.  You can learn it by using MacApp or by using TCL.  But IMHO,
  1219. using MacApp will prepare you better for a move to Bedrock.
  1220.  
  1221. If MacApp is dead, there are an awfully lot of people using a dead system. 
  1222. And the alternative is... what? TCL?  If MacApp is dead, then TCL is
  1223. buried.  I never could get into using a system what had a class called
  1224. TBartender...
  1225.  
  1226. Another thing - if you think there will be a stable, commercial-grade
  1227. version of Bedrock next January, I have some swampland in Florida to sell
  1228. you!  Apple has done a good job recently of getting stuff out to developers
  1229. (on ETO, for example), but projects of this magnitude take time, and
  1230. usually one good release, before you can count on the framework being
  1231. stable.  MacApp had a lot of development time and effort put into it, and
  1232. its structure changed radically between version 1.0 -> 2.0, and also
  1233. between 2.0 -> 3.0.  So again, you don't really gain anything by saying
  1234. "I'll wait for Bedrock."
  1235.  
  1236. Of course all of this above discussion is without regard to cost.  If
  1237. that's a factor, then maybe you would rank TCl and MacApp differently,
  1238. since it takes quite a chunk to get a platform suitable for MacApp
  1239. development.
  1240.  
  1241. > MPW's strength is for large, multi-person, multi-project development
  1242. > efforts.  Think is great if you are doing a one person-one project
  1243. > effort.
  1244.  
  1245. Of course, MPW is also good when you are mixing Pascal, C, and Assembler,
  1246. or when you are using MacApp (duh).  And the fact that MPW has scripts,
  1247. source code control, grep (for files NOT in the current project!), and lots
  1248. of other neat utilities is a plus.  I have seen MPW used for single-person
  1249. projects (that's how I use it now) and ThinkC used for multi-person
  1250. projects.  They all work, it just depends on the amount of fiddling around
  1251. you want to do.
  1252.  
  1253. > Think tends to bite it when new systems/platforms come out, where
  1254. > as MPW tends to react a bit faster.
  1255.  
  1256. Apple has sort of an advantage here, since they make the new hardware...
  1257.  
  1258. > Think does not do C++ as yet.
  1259.  
  1260. >From what I've heard, ThinkC will never do C++.  Symantec has said that
  1261. when and if they do a C++ under their name, it will be a new product.
  1262.  
  1263. > +C
  1264. > -------------------------------------------------------------
  1265. > Cory Kempf                    EnigamI, Inc.
  1266. > cory@enigami.mv.com           ...!decvax!enigami!cory
  1267. > Annon:    wi.5036@wizvax.methuen.ma.us
  1268. > "Reporter : Mr Gandhi, what do you think of Western Civilization ?
  1269. > Gandhi : I think it would be a good idea."
  1270.  
  1271.  
  1272. chuck
  1273.  
  1274.  
  1275. |- chuck mcmath - mcmath@csb1.nlm.nih.gov - MSD, Inc. ------------|
  1276. |- National Library of Medicine - National Institutes of Health --|
  1277. |- Bethesda, MD 20894 ---- Spell(e)s better than Dan Quayle ------|
  1278. |- "Hey batter, hey batter, hey batter, swing" - Anon. -----------|
  1279.  
  1280. +++++++++++++++++++++++++++
  1281.  
  1282. From: cory@enigami.mv.com (Cory Kempf)
  1283. Date: Thu, 9 Jul 92 23:58:35 EST
  1284. Organization: EnigamI, Inc., Nashua, NH
  1285.  
  1286.  
  1287. In article <mcmath-090792071452@mcmathmac.nlm.nih.gov> (comp.sys.mac.programmer), mcmath@csb1.nlm.nih.gov (Chuck McMath) writes:
  1288. >In article <0105011F.814ipu@dragon.enigami.mv.com>, cory@enigami.mv.com
  1289. >(Cory Kempf) wrote:
  1290.  
  1291. >> At present, it looks like the people who listened to Apple's
  1292. >> preaching that MacApp was it will be taking it on the chin.
  1293.  
  1294. >I think the above statements are way overblown.  Everything Apple has been
  1295. >saying is that the *kinds* of things you learn by programming in MacApp are
  1296. >going to transfer to Bedrock.
  1297.  
  1298. Yes, I am sure that the *idea* of programming within a framework will
  1299. transfere.  Personally, I think that this is rather insignificant
  1300. though, especially when one considered the learning curve of for MacApp
  1301. itself.  
  1302.  
  1303. >                          Sure, class names and some designs will be
  1304. >different, and there will be new ground to conquer, but if you think you
  1305. >will be at some sort of advantage by *waiting* then you are quite naive.
  1306.  
  1307. I don't think that there is any *advantage* to waiting.  What it looks
  1308. like (BTW, if anyone who *knows* is allowed to speak, please feel
  1309. free to correct me) is that the time & effort involved in learning MacApp
  1310. (very expensive!) would be wasted (e.g. learning things like MacApp
  1311. has a TFileBasedDocument, and how MacApp has wired it up, and how
  1312. it relates to Files, Documents, Views, etc under MacApp, the methods
  1313. to call, the names of the classes to call, etc).
  1314.  
  1315. >There's a lot to grasp when using object oriented frameworks and oo
  1316. >programming.  You can learn it by using MacApp or by using TCL.  But IMHO,
  1317. >using MacApp will prepare you better for a move to Bedrock.
  1318.  
  1319. I don't debate this.  What I do question is that for someone who does
  1320. not yet know MacApp, but does understand object programming, is it
  1321. worth the price to learn MacApp?  Given that it will be going poof
  1322. in the near future?
  1323.  
  1324. >If MacApp is dead, there are an awfully lot of people using a dead system. 
  1325.  
  1326. Apple has announced that MacApp is going to be replaced by Bedrock.
  1327. Unfortunately, nothing further about Bedrock, or the migration path
  1328. is known at present.
  1329.  
  1330. >Another thing - if you think there will be a stable, commercial-grade
  1331. >version of Bedrock next January, I have some swampland in Florida to sell
  1332. >you!
  1333.  
  1334. I don't believe it either.  What I do believe is that the MacApp team
  1335. is not working on developing a newer, better version of MacApp, nor
  1336. are they working on the promised cross-platform versions.  The release
  1337. date for bedrock (actual or announced) does not change this.
  1338.  
  1339. >Of course all of this above discussion is without regard to cost.  If
  1340. >that's a factor, then maybe you would rank TCl and MacApp differently,
  1341. >since it takes quite a chunk to get a platform suitable for MacApp
  1342. >development.
  1343.  
  1344. The major cost as *I* see it is the learning time.  For MacApp, this
  1345. is very expensive.  Since MacApp is slated to be orphaned, this means
  1346. that this learning time will not have a long term payoff.  At present,
  1347. it is unknown how similar the structure of Bedrock will be w.r.t.
  1348. MacApp.  E.g., how much of that learning curve time is wasted.  
  1349.  
  1350. So, back to my original question: given the announced end of MacApp
  1351. future development, does it make sense to continue trying to learn
  1352. MacApp?
  1353.  
  1354. +C
  1355.  
  1356.  
  1357. - -------------------------------------------------------------
  1358. Cory Kempf                    EnigamI, Inc.
  1359. cory@enigami.mv.com           ...!decvax!enigami!cory
  1360. Annon:    wi.5036@wizvax.methuen.ma.us
  1361.  
  1362. "F' cryin' out loud, it's *your* life; shouldn't you at least examine 
  1363. your lifestyle values to see if they are really what *you* want."
  1364.                                         --Keith Lim
  1365.  
  1366. +++++++++++++++++++++++++++
  1367.  
  1368. From: lsr@taligent.com (Larry Rosenstein)
  1369. Date: 10 Jul 92 16:59:08 GMT
  1370. Organization: Taligent, Inc.
  1371.  
  1372. In article <0105011F.850pa1@dragon.enigami.mv.com>, cory@enigami.mv.com
  1373. (Cory Kempf) wrote:
  1374. > Yes, I am sure that the *idea* of programming within a framework will
  1375. > transfere.  Personally, I think that this is rather insignificant
  1376.  
  1377. I don't think it's insignificant for the typical programmer (who has no
  1378. exposure to object-oriented programming).
  1379.  
  1380. > though, especially when one considered the learning curve of for MacApp
  1381. > itself. 
  1382.  
  1383. It also depends on the person's current experience.  If they are pretty
  1384. familiar with programming the Macintosh, then it may not bve worthwhile
  1385. learning MacApp.  (That may be true regardless of MacApp's status.)
  1386.  
  1387. If they are not familiar with programming the Macintosh, then it's probably
  1388. easier to go the MacApp or TCL route than trying to read Inside Mac.  
  1389.  
  1390. > free to correct me) is that the time & effort involved in learning MacApp
  1391. > (very expensive!) would be wasted (e.g. learning things like MacApp
  1392.  
  1393. It's not clear at the time if it will be a total waste or not.  I suspect
  1394. that most of the same concepts will carry over.  There are several general
  1395. concepts in MacApp (change propagation, behaviors, etc.) that may be useful
  1396. to learn about.
  1397.  
  1398. At last night's BAMADA meeting, one of the people involved estimated that
  1399. the transition from MacApp 3.0 to Bedrock would be roughly equivalent to
  1400. the transition from MacApp 2.0 to 3.0.
  1401.  
  1402. > not yet know MacApp, but does understand object programming, is it
  1403. > worth the price to learn MacApp?  Given that it will be going poof
  1404.  
  1405. If someone is already familiar with object programming and frameworks, then
  1406. probably not.  They should just stick with whatever they're using.  But I
  1407. would give the same advice even if there was no Bedrock.
  1408.  
  1409. > >Another thing - if you think there will be a stable, commercial-grade
  1410. > >version of Bedrock next January, I have some swampland in Florida to sell
  1411. > I don't believe it either.  What I do believe is that the MacApp team
  1412. > is not working on developing a newer, better version of MacApp, nor
  1413. > are they working on the promised cross-platform versions.  The release
  1414.  
  1415. Well the fact is that Symantec has been working on Bedrock for over 2
  1416. years, so it's not as if they are starting from scratch.  Apparently, most
  1417. of the effort between now and the ship date involves adding some of the
  1418. features that MacApp 3.0 has and improving the documentation to the point
  1419. where it can be a commercial product.  (There's a difference between a tool
  1420. used internally and one that you sell to others.)
  1421.  
  1422. I'm not sure what you're referring to above, but members of the MacApp team
  1423. are working at Symantec on Bedrock. 
  1424.  
  1425. > So, back to my original question: given the announced end of MacApp
  1426. > future development, does it make sense to continue trying to learn
  1427. > MacApp?
  1428.  
  1429. It depends on the person.  If you already are using TCL, then it doesn't
  1430. make sense.  If you've never used any kind of framework then MacApp is a
  1431. reasonable alternative.  (Especially, if you want to ship your product in
  1432. the next year or so.)
  1433.  
  1434. Larry Rosenstein
  1435. Taligent, Inc.
  1436.  
  1437. lsr@taligent.com
  1438.  
  1439. +++++++++++++++++++++++++++
  1440.  
  1441. From: lsr@taligent.com (Larry Rosenstein)
  1442. Date: 10 Jul 92 17:03:19 GMT
  1443. Organization: Taligent, Inc.
  1444.  
  1445. In article <92188.205418CHARLESW@QUCDN.QueensU.CA>,
  1446. CHARLESW@QUCDN.QueensU.CA wrote:
  1447. > 2)  Larry Rosenstein modestly doesn't mention that there is a good book on
  1448. >     MacApp (2.x) that he co-authored.  I don't know if there will be "update"
  1449.  
  1450. As far as I know there's no update planned.  We aren't working on one, and
  1451. although there's been rumors of other's picking it up, I don't think it
  1452. will happen.
  1453.  
  1454. Larry Rosenstein
  1455. Taligent, Inc.
  1456.  
  1457. lsr@taligent.com
  1458.  
  1459. ---------------------------
  1460.  
  1461. End of C.S.M.P. Digest
  1462. **********************
  1463.